package com.books.mapper.shoppingcar;



import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.books.model.entity.shopping.ShoppingCar;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author ZhouRui
 * @title: 码上就来
 * @projectName cbstore-spring-boot
 * @description: TODO
 * @date 2021/10/417:05
 */


public interface ShoppingCarMapper extends BaseMapper<ShoppingCar> {

    @Select("select * from shopping_car where user_id=#{uid}")
    List<ShoppingCar> findAll(int uid);

    @Update("update shopping_car set remark=0 where id=#{id}")
    void delById(int id);

    @Select("select * from shopping_car where book_id=#{id}")
    ShoppingCar getByBid(Integer id);


}
